package core.util;

public class PageText
{

    private static final String docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 "
            + "Transitional//EN\">\n";

    private static final String HOME_PAGE_FORMAT = "<html><body>"
            + "<title>yt347-assignment-3</title><br>&nbsp;<br>"
            + "<big><b>(%s)&nbsp;&nbsp;%s<br>&nbsp;<br></b></big>"
            + "<form method=GET action='replace'>"
            + "<input type='submit' name='cmd' value='Replace'/>&nbsp;&nbsp;"
            + "<input type=text name=NewText size=40 maxlength=512 />&nbsp;&nbsp;"
            + "</form><br>"
            + "<form method=GET action='home'><input type='submit' value='Refresh' /></form><br>"
            + "<form method=GET action='logout'><input type='submit' name='cmd' value='Log Out' /></form>"
            + "</body></html>";

    public static String getHomeHTML( int displayCount, String displayMessage ) {
        return docType
                + String.format( HOME_PAGE_FORMAT, displayCount, displayMessage );
    }
}
